From 2cafb4b4e90bae0afc8b1db7fd01980803dd8b14 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 17 Dec 2005 02:11:54 +0100 Subject: [PATCH] Small fix to the error-return path after calling __copy_to_user in the swiotlb sync function. We cannot immediately exit the sync function as there may be tail work to do (e.g., kunmap_atomic). In fact, doing nothing is the right thing to do and is sufficient to avoid compiler warnings about not checking the __copy_to_user return value. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c index bf9c215a31..def082cba2 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c @@ -223,7 +223,7 @@ __sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir) host = kmp + buffer.offset; if (dir == DMA_FROM_DEVICE) { if (__copy_to_user(host, dev, bytes)) - return; /* inaccessible */ + /* inaccessible */; } else memcpy(dev, host, bytes); kunmap_atomic(kmp, KM_SWIOTLB); @@ -236,7 +236,7 @@ __sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir) page_to_pseudophys(buffer.page)) + buffer.offset; if (dir == DMA_FROM_DEVICE) { if (__copy_to_user(host, dma_addr, size)) - return; /* inaccessible */ + /* inaccessible */; } else if (dir == DMA_TO_DEVICE) memcpy(dma_addr, host, size); } -- 2.30.2